﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<B10.Models.UserPageViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Model.Page.Title %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <meta name="keywords" content="<%=Model.Page.Keywords %>" />
    <meta name="description" content="<%=Model.Page.Description %>" />
    <meta property="og:title" content="<%=Model.Page.Title %>"/>
    <meta property="og:type" content="article"/>
    <meta property="og:url" content="<%=Url.Action("Page", "Home", new { pageUrl = Model.Page.Url, id = Model.Page.Id })%>"/>
    <meta property="og:site_name" content="Juntos.pl"/>   
    <meta property="og:description" content="<%=Model.Page.Description %>"/>
    
    <%if (!String.IsNullOrEmpty(Model.Page.Thumbnail))
              {%>
    <meta property="og:image" 
    content="http://<%=Request.Url.Authority %><%= Html.AttributeEncode(Model.Page.Thumbnail)%>"/>
    <link rel="image_src" 
    href="http://<%=Request.Url.Authority %><%= Html.AttributeEncode(Model.Page.Thumbnail)%>"/>
    <%} %>
    
    <link href="/Content/slimbox2.css" rel="stylesheet" type="text/css" />

    <script src="/Scripts/slimbox2.js" type="text/javascript"></script>

    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>

    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>

    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>

    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>

    <script src="../../Scripts/ckeditor.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="ui-corner-all ui-helper-clearfix alternate-header" id="tabs">
        <div class="ui-widget-header-title">
            Kategorie : &nbsp; <span>
                <%string categoryName = B10.Models.CategoryHelper.GetCategoryName(Model.Page.Category); %>
                <%=Html.RouteLink(categoryName, "Categories", 
            new { categoryName = categoryName, category = (int)Model.Page.Category, page = 1 },
            new {title = categoryName})%>
                <% if (Model.Page.Category2.HasValue)
                   {
                       categoryName = B10.Models.CategoryHelper.GetCategoryName(Model.Page.Category2.Value); %>
                /
                <%=Html.RouteLink(categoryName, "Categories", 
               new { categoryName = categoryName, category = (int)Model.Page.Category2.Value, page = 1 }, 
               new { title = categoryName })%>
                <%} %>
                <%if (Model.Page.Category3.HasValue)
                  {
                      categoryName = B10.Models.CategoryHelper.GetCategoryName(Model.Page.Category3.Value); %>
                /
                <%=Html.RouteLink(categoryName, "Categories", 
               new { categoryName = categoryName, category = (int)Model.Page.Category3.Value, page = 1 }, 
               new { title = categoryName })%>
                <%} %>
            </span>
        </div>
    </div>
    <div class="clear">
    </div>
    <div class="page-body">
        <div class="page-item-header">
            <h1>
                <%=Html.Encode(Model.Page.Title) %></h1>
            <ul class="meta-info">
                <%if (Model.Page.PublishDate.HasValue)
                  { %>
                <li>Data: <strong>
                    <%= Html.Encode(Model.Page.PublishDate.Value.ToShortDateString()) + " " + Html.Encode(Model.Page.PublishDate.Value.ToShortTimeString())%>
                </strong></li>
                <%} %>
                <li>Odsłon: <strong>
                    <%= Html.Encode(Model.Page.PageViews)%>
                </strong></li>
                <li>
                    <!-- AddThis Button BEGIN -->

                    <script type="text/javascript">
                        var addthis_config = {
                            "data_track_clickback": true,
                            services_exclude: 'print',
                            ui_language: 'pl'
                        };
                    </script>

                    <div class="addthis_toolbox addthis_default_style">
                        <a class="addthis_button_facebook"></a><a class="addthis_button_wykop"></a><a class="addthis_button_twitter">
                        </a><a class="addthis_button_googlebuzz"></a><a class="addthis_button_blip"></a>
                        <a class="addthis_button_flaker"></a><a class="addthis_button_email"></a><span class="addthis_separator">
                            |</span> <a class="addthis_button_compact">Więcej</a>
                    </div>

                    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=juntos"></script>

                    <!-- AddThis Button END -->
                </li>
                <li class="last">
                    <fb:like layout="button_count" show_faces="false" width="150">
                    </fb:like>
                </li>
            </ul>
            <div class="clear">
            </div>
        </div>
        <div class="page-item-body">
            <%if (!String.IsNullOrEmpty(Model.Page.Thumbnail))
              {%>
            <img alt="<%=Html.Encode(Model.Page.Title) %>" class="left small-image" src="<%= Html.AttributeEncode(Model.Page.Thumbnail)%>" />
            <%} %>
            <h3>
                <%=Html.Encode(Model.Page.Description) %></h3>
            <div class="clear">
            </div>
            <div class="center inline-adsense">
                <%=Html.Adsense(Model.Profile.AdsenseCode) %>
            </div>
            <div>
                <%=Model.Page.Content %>
            </div>
            <div class="center inline-adsense">
                <%=Html.Adsense(Model.Profile.AdsenseCode) %>
            </div>
        </div>
        <div id="comments">
            <%Html.RenderPartial("Comments", Model.Page); %>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightColumnContent" runat="server">
    <div class="ui-widget ui-widget-content ui-corner-all sidebar-box-wrapper">
        <div class="ui-widget-header ui-corner-all ui-helper-clearfix">
            <span class="ui-widget-header-title">Autor</span>
        </div>
        <div class="sidebar-box">
            <div class="small-image left">
                <img src='<%=Html.AttributeEncode(Model.Profile.Avatar) %>' />
            </div>
            <div class="left author-bio">
                <span class="link-wrapper">
                    <%=Html.ActionLink(Html.Encode(Model.Profile.DisplayName), "Index", "PublicProfile",
                                new { id = Html.AttributeEncode(Model.Profile.Id),
                                    name=Html.AttributeEncode(Model.Profile.DisplayName) }, null)%>
                </span>
                <br />
                <% if (Model.Profile.Gender == B10.Models.GenderEnum.Male)
                   { %>
                <%=Strings.Male%>,
                <%}
                   else if (Model.Profile.Gender == B10.Models.GenderEnum.Female)
                   {%>
                <%=Strings.Female%>,
                <%} %>
                <% if (Model.Profile.BirthDate.HasValue)
                   { %><b>
                       <%=(DateTime.Now.Year - Model.Profile.BirthDate.Value.Year).ToString()%>
                       lat</b>
                <%} %>
                <br />
                Stron: <b>
                    <%=Model.PagesCount %></b>
                <br />
                Komentarzy: <b>
                    <%=Model.CommentsCount %></b>
                <%if (!String.IsNullOrEmpty(Model.Profile.Website))
                  {
                %>
                <br />
                <span class="link-wrapper"><a href='<%=Html.AttributeEncode(Model.Profile.Website)%>'
                    rel="nofollow">www </a></span>
                <%} %>
            </div>
            <div class="clear">
            </div>
            <div class="author-desc">
                <%= Html.Encode(Model.Profile.Tagline) %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="rightBottomContent" ContentPlaceHolderID="RightColumnBottomContent"
    runat="server">
    <%--<%Html.RenderPartial("SmallPageList", Model.AdditionalPages); %>--%>

    <script type="text/javascript">
        $.post("/Preview/Track/<%=Model.Page.Id %>");
    </script>

</asp:Content>
